package cn.hotel.mapper;

import cn.hotel.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
public interface UserMapper {
    public User queryUserByUserAndPass(@Param("username") String username,@Param("password") String password);

    public User queryUserById(@Param("userId") String userId);

    public int addUser(User user);

    public int updatePassword(@Param("phone")String phone, @Param("password") String password);

    //获取用户的数量
    int getUsers();

    public List<User> allUser();

    public int deleteByUserId(@Param("userId") Integer userId);

    public int userCount();

    public User queryById(@Param("userId") Integer userId);

    public int updateUser(User user);

    public List<User> getUserByName(String name);
}
